using System.Diagnostics;
using System.Xml.Linq;

namespace DeclarativeTest.Core
{
	public class ParseFilter
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="T:System.Object"/> class.
		/// </summary>
		public ParseFilter( )
		{
			ParseActions = true;
		}

		public bool ParseActions{ get; set; }
	}

	public class ParseContext
	{
		public XElement Element{ get; set; }
		public DataContext DataContext{ get; private set; }
		public ITestSuiteFactory Factory{ get; set; }
		public ParseFilter Filter { get; set; }

		#region .ctor

		/// <summary>
		/// Initializes a new instance of the <see cref="T:System.Object"/> class.
		/// </summary>
		[DebuggerStepThrough]
		public ParseContext( ParseContext parent ):this( parent, null )
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="T:System.Object"/> class.
		/// </summary>
		//[DebuggerStepThrough]
		public ParseContext( ParseContext parent, XElement element )
		{
			Element = element;

			if( parent != null )
			{
				DataContext = new DataContext( parent.DataContext );
				Factory = parent.Factory;
				Filter = parent.Filter;
			}
			else
			{
				DataContext = new DataContext( null );
				Filter = new ParseFilter();
			}
		}

		#endregion
	}
}